const Mock = require('mockjs')
const { Random } = require('mockjs')

Mock.mock('/api/productListData', (req, res) => {
  const data = []
  for (let i = 0; i < 16; i++) {
    const color = '#' + Random.integer(180, 255).toString(16) +
      Random.integer(140, 255).toString(16) +
      Random.integer(120, 220).toString(16)
    data.push({
      image: Random.image('140x140', color, ' IMAGE '),
      productName: Random.ctitle(),
      productPrice: Random.float(10, 1000, 2, 3),
      productSell: Random.integer(100, 10000),
      isFreeShipping: Random.boolean()
    })
  }

  return data
})
